package valeria;

public class J12Fan {

	public static void main(String[]args){
		Fan yfan=new Fan();
		yfan.radius=10;
		yfan.color="yellow";
		yfan.speed=yfan.FAST;
		yfan.on=true;
		System.out.println(yfan.toString());

		Fan bfan=new Fan();
		bfan.radius=5;
		bfan.color="blue";
		bfan.speed=2;
		bfan.on=false;
		System.out.println(bfan.toString());
		
		
	}//main
}//class

class Fan{
	final int SLOW=1;
	final int MEDIUM=2;
	final int FAST=3;
   
	int speed=SLOW;
	boolean on=false;
	double radius=5.0;
	String color="blue";
	
@Override //부모클래스에서  정의된 메서드를 자손class에서 다시정의함 
	public String toString() {
		String result="";
		if(on==true){
		result+=speed+"/"+color+"/"+radius+"/"+"작동중";
		}else{
		result+=speed+"/"+"color"+"/"+radius+"/"+"꺼져있음";
		}
		return result;
		
}	
	
	
	
	
	
}